package demo

import "fmt"

// 定义结构体
type Person struct {
	Name string
	Age  int
}

// 绑定方法
func (p Person) SayHello() {
	fmt.Printf("Hello, my name is %s and I am %d years old.\n", p.Name, p.Age)
}

func TestStruct() {
	p := Person{Name: "Alice", Age: 30}
	p.SayHello()
}
